package com.sny.dto;

import java.util.List;
import java.util.Map;
import java.util.Objects;

public class FileUploadDTO {

  /**
   * 文件路径
   */
  private String path;
  /**
   * 类型
   */
  private Integer mtime;

  private boolean uploadComplete;

  private int code;

  private Map<Integer,String> chunkMd5Info;

  private List<Integer> missChunks;

  private long size;

  private String fileExt;

  private String fileId;


  public FileUploadDTO(String path, Integer mtime, boolean uploadComplete, int code, Map<Integer, String> chunkMd5Info, List<Integer> missChunks, long size, String fileExt, String fileId) {
    this.path = path;
    this.mtime = mtime;
    this.uploadComplete = uploadComplete;
    this.code = code;
    this.chunkMd5Info = chunkMd5Info;
    this.missChunks = missChunks;
    this.size = size;
    this.fileExt = fileExt;
    this.fileId = fileId;
  }

  public FileUploadDTO() {
  }

  public static FileUploadDTOBuilder builder() {
    return new FileUploadDTOBuilder();
  }

  public String getPath() {
    return this.path;
  }

  public Integer getMtime() {
    return this.mtime;
  }

  public boolean isUploadComplete() {
    return this.uploadComplete;
  }

  public int getCode() {
    return this.code;
  }

  public Map<Integer, String> getChunkMd5Info() {
    return this.chunkMd5Info;
  }

  public List<Integer> getMissChunks() {
    return this.missChunks;
  }

  public long getSize() {
    return this.size;
  }

  public String getFileExt() {
    return this.fileExt;
  }

  public String getFileId() {
    return this.fileId;
  }

  public void setPath(String path) {
    this.path = path;
  }

  public void setMtime(Integer mtime) {
    this.mtime = mtime;
  }

  public void setUploadComplete(boolean uploadComplete) {
    this.uploadComplete = uploadComplete;
  }

  public void setCode(int code) {
    this.code = code;
  }

  public void setChunkMd5Info(Map<Integer, String> chunkMd5Info) {
    this.chunkMd5Info = chunkMd5Info;
  }

  public void setMissChunks(List<Integer> missChunks) {
    this.missChunks = missChunks;
  }

  public void setSize(long size) {
    this.size = size;
  }

  public void setFileExt(String fileExt) {
    this.fileExt = fileExt;
  }

  public void setFileId(String fileId) {
    this.fileId = fileId;
  }

  public boolean equals(final Object o) {
    if (o == this) return true;
    if (!(o instanceof FileUploadDTO)) return false;
    final FileUploadDTO other = (FileUploadDTO) o;
    if (!other.canEqual((Object) this)) return false;
    final Object this$path = this.getPath();
    final Object other$path = other.getPath();
    if (!Objects.equals(this$path, other$path)) return false;
    final Object this$mtime = this.getMtime();
    final Object other$mtime = other.getMtime();
    if (!Objects.equals(this$mtime, other$mtime)) return false;
    if (this.isUploadComplete() != other.isUploadComplete()) return false;
    if (this.getCode() != other.getCode()) return false;
    final Object this$chunkMd5Info = this.getChunkMd5Info();
    final Object other$chunkMd5Info = other.getChunkMd5Info();
    if (!Objects.equals(this$chunkMd5Info, other$chunkMd5Info))
      return false;
    final Object this$missChunks = this.getMissChunks();
    final Object other$missChunks = other.getMissChunks();
    if (!Objects.equals(this$missChunks, other$missChunks))
      return false;
    if (this.getSize() != other.getSize()) return false;
    final Object this$fileExt = this.getFileExt();
    final Object other$fileExt = other.getFileExt();
    if (!Objects.equals(this$fileExt, other$fileExt)) return false;
    final Object this$fileId = this.getFileId();
    final Object other$fileId = other.getFileId();
    if (!Objects.equals(this$fileId, other$fileId)) return false;
    return true;
  }

  protected boolean canEqual(final Object other) {
    return other instanceof FileUploadDTO;
  }

  @Override
  public int hashCode() {
    final int PRIME = 59;
    int result = 1;
    final Object $path = this.getPath();
    result = result * PRIME + ($path == null ? 43 : $path.hashCode());
    final Object $mtime = this.getMtime();
    result = result * PRIME + ($mtime == null ? 43 : $mtime.hashCode());
    result = result * PRIME + (this.isUploadComplete() ? 79 : 97);
    result = result * PRIME + this.getCode();
    final Object $chunkMd5Info = this.getChunkMd5Info();
    result = result * PRIME + ($chunkMd5Info == null ? 43 : $chunkMd5Info.hashCode());
    final Object $missChunks = this.getMissChunks();
    result = result * PRIME + ($missChunks == null ? 43 : $missChunks.hashCode());
    final long $size = this.getSize();
    result = result * PRIME + (int) ($size >>> 32 ^ $size);
    final Object $fileExt = this.getFileExt();
    result = result * PRIME + ($fileExt == null ? 43 : $fileExt.hashCode());
    final Object $fileId = this.getFileId();
    result = result * PRIME + ($fileId == null ? 43 : $fileId.hashCode());
    return result;
  }

  @Override
  public String toString() {
    return "FileUploadDTO(path=" + this.getPath() + ", mtime=" + this.getMtime() + ", uploadComplete=" + this.isUploadComplete() + ", code=" + this.getCode() + ", chunkMd5Info=" + this.getChunkMd5Info() + ", missChunks=" + this.getMissChunks() + ", size=" + this.getSize() + ", fileExt=" + this.getFileExt() + ", fileId=" + this.getFileId() + ")";
  }

  public static class FileUploadDTOBuilder {
    private String path;
    private Integer mtime;
    private boolean uploadComplete;
    private int code;
    private Map<Integer, String> chunkMd5Info;
    private List<Integer> missChunks;
    private long size;
    private String fileExt;
    private String fileId;

    FileUploadDTOBuilder() {
    }

    public FileUploadDTO.FileUploadDTOBuilder path(String path) {
      this.path = path;
      return this;
    }

    public FileUploadDTO.FileUploadDTOBuilder mtime(Integer mtime) {
      this.mtime = mtime;
      return this;
    }

    public FileUploadDTO.FileUploadDTOBuilder uploadComplete(boolean uploadComplete) {
      this.uploadComplete = uploadComplete;
      return this;
    }

    public FileUploadDTO.FileUploadDTOBuilder code(int code) {
      this.code = code;
      return this;
    }

    public FileUploadDTO.FileUploadDTOBuilder chunkMd5Info(Map<Integer, String> chunkMd5Info) {
      this.chunkMd5Info = chunkMd5Info;
      return this;
    }

    public FileUploadDTO.FileUploadDTOBuilder missChunks(List<Integer> missChunks) {
      this.missChunks = missChunks;
      return this;
    }

    public FileUploadDTO.FileUploadDTOBuilder size(long size) {
      this.size = size;
      return this;
    }

    public FileUploadDTO.FileUploadDTOBuilder fileExt(String fileExt) {
      this.fileExt = fileExt;
      return this;
    }

    public FileUploadDTO.FileUploadDTOBuilder fileId(String fileId) {
      this.fileId = fileId;
      return this;
    }

    public FileUploadDTO build() {
      return new FileUploadDTO(path, mtime, uploadComplete, code, chunkMd5Info, missChunks, size, fileExt, fileId);
    }

    @Override
    public String toString() {
      return "FileUploadDTO.FileUploadDTOBuilder(path=" + this.path + ", mtime=" + this.mtime + ", uploadComplete=" + this.uploadComplete + ", code=" + this.code + ", chunkMd5Info=" + this.chunkMd5Info + ", missChunks=" + this.missChunks + ", size=" + this.size + ", fileExt=" + this.fileExt + ", fileId=" + this.fileId + ")";
    }
  }
}
